# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=kosmindoormap
pkgver=22.04.3
pkgrel=0
# armhf blocked by qt5-qtdeclarative
arch="all !armhf"
url="https://invent.kde.org/libraries/kosmindoormap"
pkgdesc="OSM multi-floor indoor map renderer"
license="BSD-2-Clause AND BSD-3-Clause MIT AND LGPL-2.0-or-later"
depends_dev="
	ki18n-dev
	kpublictransport-dev
	protobuf-dev
	qt5-qtbase-dev
	qt5-qtdeclarative-dev
	zlib-dev
	"
makedepends="$depends_dev
	bison
	extra-cmake-modules
	flex
	samurai
	"
source="https://download.kde.org/stable/release-service/$pkgver/src/kosmindoormap-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-lang"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	cd build

	local skipped_tests="("
	local tests="
		"
	if [ "$CARCH" = "x86" ]; then
		tests="$tests
			levelparser
			platformfinder
			"
	fi
	for test in $tests; do
		skipped_tests="$skipped_tests|$test"
	done
	skipped_tests="$skipped_tests)test"
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest -E "$skipped_tests"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
f272b250142a4ae6275b0234ff3ebbadb1eebe2302d28286de47c230363bfd7f153574fad4a7f2ada3507db80552dce1f0fc49ae9db5427d144ce0bbc3052b5f  kosmindoormap-22.04.3.tar.xz
"
